package com.levi.SimpleFactoryMode.Operation;

/**
 * @author Levi
 * @description :  Operation的除法类
 * @since 2022/8/31 10:57
 */

public class OperationDiv extends Operation {

    @Override
    public double getResult() {
        if (this.getNumberB() == 0) {
            try {
                throw new Exception("除数不能为0");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return this.getNumberA() / this.getNumberB();
    }
}
